<?php

namespace App\Models\Tool;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;

class FileUrl extends Model
{
    use HasDateTimeFormatter;

    protected $table = 'file_urls';
    protected $fillable = ['domain', 'url', 'module', 'is_category', 'is_type', 'sign'];

    const IMAGE_SIGN = 'picture';
    const AUDIO_SIGN = 'audio';
    const VIDEO_SIGN = 'video';

    const IS_CATEGORY_OFF = 0;
    const IS_CATEGORY_ON = 1;
    public static array $IsCategoryMap = [
        self::IS_CATEGORY_OFF => '关闭',
        self::IS_CATEGORY_ON => '开启',
    ];

    const IS_TYPE_OFF = 0;
    const IS_TYPE_ON = 1;
    public static array $IsTypeMap = [
        self::IS_TYPE_OFF => '关闭',
        self::IS_TYPE_ON => '开启',
    ];

    // 模块类型映射（如果没有CategoryModule类，可以在这里定义）
    public static array $moduleTypeMap = [
        1 => '语音测评',
        2 => '趣味互动-看动画',
        3 => '趣味互动-歌曲歌谣',
        4 => '词汇积累-背单词',
        5 => '词汇积累-学单词',
        6 => '磨耳朵',
        7 => '趣味闯关',
        8 => '有声拓展',
    ];
}
